<?php

header("Content-type:text/html;charset=utf-8"); 

require_once("config.php");

global $cin;

$cin = mysqli_connect(mysqlurl,mysqluser,mysqlpss);

mysqli_query($cin,"SET NAMES UTF8");

if(!$cin){
    die('数据库连接失败: 请查看数据库账户密码是否正确' . mysqli_connect_error());
}

function detectionTime($time,$id,$cin){
    mysqli_select_db($cin,"hongbao");
    date_default_timezone_set('PRC');
    $nowTime = time();
    if($nowTime - $time > 86400 && $cin){
        $dele = mysqli_query($cin,"DELETE FROM userinfo WHERE id=$id");
        if($dele){
            echo 'ok';
            return true;
        }else{
            echo '删除失败';
        }
    }
};

?>

